import yagmail,logging,os

def log():
    logging.basicConfig(filename='log.txt',filemode='a+',level=logging.DEBUG,datefmt='%(asctim)->%(levelname)->%(message)')

def send_email(filename):
    email=yagmail.SMTP(user='1038995773@qq.com',password='pahznimdvxdtbegi',host='smtp.qq.com')
    email.send(to='1038995773@qq.com',subject='测试报告',contents='报告内容',attachments=filename)